import { defineConfig } from "vite"
import vue from "@vitejs/plugin-vue"
import qiankun from "vite-plugin-qiankun"
const packageName = require("./package.json").name
// https://vitejs.dev/config/
export default defineConfig({
  server: {
    port: 3000,
    cors: true,
    origin: "http://127.0.0.1:3000",
  },
  plugins: [
    vue(),
    qiankun("vitesub1", {
      useDevMode: true,
    }),
  ],
  output: {
    library: `${packageName}-[name]`,
    libraryTarget: "umd",
    chunkLoadingGlobal: `webpackJsonp_${packageName}`,
  },
})
